<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="#" type="image/png">

    <title>Login</title>

    <link href="../static/css/style.css" rel="stylesheet">
    <link href="../static/css/style-responsive.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="../static/js/html5shiv.js"></script>
    <script src="../static/js/respond.min.js"></script>
    <![endif]-->
</head>

<body class="login-body">

<div class="container">

    <form class="form-signin" action="/login/" method="post">
<!--    <form class="form-signin" id="login_form">-->
        {% csrf_token %}

        <div class="form-signin-heading text-center">
            <h1 class="sign-title">登 录</h1>
            <img src="../static/images/login-logo.png" alt=""/>
        </div>
        <div class="login-wrap">
            <input type="text" class="form-control" placeholder="用户名" autofocus name="username" id="username">
            <input type="password" class="form-control" placeholder="密码" name="pwd" id="pwd">

            <button class="btn btn-lg btn-login btn-block" type="submit_btn" name="submit_btn" id="submit_btn">
                <i class="fa fa-check"></i>
            </button>

            <div class="registration">
                还不是会员？
                <a class="" href="registration.html">
                    注册
                </a>
            </div>
            <label class="checkbox">
                <input type="checkbox" value="remember-me"> 记住
                <span class="pull-right">
                    <a data-toggle="modal" href="#myModal"> 忘记密码？</a>

                </span>
            </label>

        </div>

        <!-- Modal -->
        <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title">忘记密码？</h4>
                    </div>
                    <div class="modal-body">
                        <p>Enter your e-mail address below to reset your password.</p>
                        <input type="text" name="email" placeholder="Email" autocomplete="off" class="form-control placeholder-no-fix">

                    </div>
                    <div class="modal-footer">
                        <button data-dismiss="modal" class="btn btn-default" type="button">Cancel</button>
                        <button class="btn btn-primary" type="button">Submit</button>
                    </div>
                </div>
            </div>
        </div>
        <!-- modal -->

    </form>

</div>



<!-- Placed js at the end of the document so the pages load faster -->

<!-- Placed js at the end of the document so the pages load faster -->
<script src="../static/js/jquery-1.10.2.min.js"></script>
<script src="../static/js/bootstrap.min.js"></script>
<script src="../static/js/modernizr.min.js"></script>

<!-- javascript 事件绑定 -->
<!--<script>-->
<!--    $(document).ready(function(){-->
<!--        var username_state = false-->
<!--        var pwd_state = false-->

<!--        $('#username').blur(function(){-->
<!--            if($(this).val() == ''){-->
<!--                $(this).css("border",'2px solid red');-->
<!--                $(this).attr("placeholder", "用户名为空，请输入用户名");-->

<!--                $('#submit_btn').attr("disabled", true);-->

<!--            }else{-->
<!--                $(this).css("border", '1px solid #eaeaec');-->

<!--                username_state = true;-->
<!--                if (pwd_state == true){-->
<!--                    $('#submit_btn').attr("disabled", false);-->
<!--                };-->
<!--            }-->
<!--        });-->

<!--        $('#pwd').blur(function(){-->
<!--            if($(this).val() == ''){-->
<!--                $(this).css("border", '2px solid red')-->
<!--                $(this).attr("placeholder", '密码为空，请输入密码')-->

<!--                $('#submit_btn').attr("disabled", true);-->
<!--            }else{-->
<!--                $(this).css("border", '1px solid #eaeaec');-->

<!--                pwd_state = true;-->
<!--                if (username_state == true){-->
<!--                    $('#submit_btn').attr("disabled", false);-->
<!--                };-->
<!--            }-->
<!--        });-->

<!--        $("#submit_btn").click(function(){-->
<!--            $.post("/login/",-->
<!--                $("#login_form").serialize(),-->
<!--                function(data,statu){-->
<!--                    if (data.code ==102){-->
<!--                        $("#username").css("border","2px solid red");-->
<!--                        $("#submit_btn").attr("disabled",true);-->
<!--                        $("#username").val("");-->
<!--                        $("#username").attr("placeholder",data.mag);-->
<!--                    }else if(data.code == 103){-->
<!--                        $("#pwd").css("border", "2px solid red");-->
<!--                        $("#submit_btn").attr("disabled",true);-->
<!--                        $("#pwd").val("");-->
<!--                        $("#pwd").attr("placeholder",data.mag);-->
<!--                    }-->
<!--                });-->
<!--        });-->
<!--    });-->
<!--</script>-->

</body>
</html>
